package com.lry.rpc.config;

public class NettyBaseConfig {

    protected static final int MAX_READ_IDLE_SECONDS = 150;
    protected static final int MAX_WRITE_IDLE_SECONDS = 100;
    protected static final int MAX_ALL_IDLE_SECONDS = 100;
    protected  String REGISTRY_SERVICE_ADDRESS = "localhost:2181";
    protected  String REGISTRY_TYPE = "zookeeper";


    //zookeeper://127.0.0.1:2181
    public void setRegistryAddress(String address){
        String[] split = address.split("://");
        this.REGISTRY_SERVICE_ADDRESS = split[1];
        this.REGISTRY_TYPE = split[0];
    }
    public String getRegistryServiceAddress() {
        return REGISTRY_SERVICE_ADDRESS;
    }

    public String getRegitryType() {
        return REGISTRY_TYPE;
    }

    public static int getMaxAllIdleSeconds() {
        return MAX_ALL_IDLE_SECONDS;
    }

    public static int getMaxReadIdleSeconds() {
        return MAX_READ_IDLE_SECONDS;
    }

    public static int getMaxWriteIdleSeconds() {
        return MAX_WRITE_IDLE_SECONDS;
    }

}
